{template header}
{if $search}
<style type="text/css">
    .tagDiv{clear: both;}
    .table-striped td,
    .table-striped th {text-align: center; }
    .table-striped th { background: rgba(232, 247, 250, 0.9); margin-bottom: 10px; }
    .table-striped td { min-width: 50px; }
    .table-striped td:nth-child(1) a:nth-of-type(2) {word-break:break-all; width: 60px; text-align: left; }
    .table-striped td:last-child a { display:inline-block; margin: 3px 0; }
    .table-striped td img { width: 36px; height: 36px; }
    .table-striped td:nth-child(1){ min-width: 180px; max-width: 200px; }
    .table-striped td:nth-child(2){ min-width: 100px;  }
    .search-group { margin:15px 30px; }
    .table-striped td:nth-child(9) img,
    .table-striped td:nth-child(10) img,
    .table-striped td:nth-child(11) img,
    .table-striped td:nth-child(12) img,
    .table-striped td:nth-child(13) img{ outline: none; border: none; }
    .table-striped td:last-child {min-width: 100px;}
</style>
<h4 style="padding-left:10px;;">搜索 <i class="icon-search"></i></h4>
<form class="form-horizontal clearfix form-inline" method="post" action="">
    <p>填写昵称后忽略其他项目。数字昵称只能从开始匹配，即18匹配1800，不匹配0018</p>
    <div class="control-group search-group">
        <label class="control-label" >昵称或ID：</label>
        <div class="controls">
          <input type="text" placeholder="设置后其他选项忽略" name="nickname" value="{$search['nickname']}">
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label">选择性别：</label>
        <div class="controls">
            <select name="gender">
                <option value="">请选择</option>
                <option {if $search['gender'] == 1}selected="selected"{/if} value="1">男</option>
                <option {if $search['gender'] == 2}selected="selected"{/if} value="2">女</option>
            </select>
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label">QQ：</label>
        <div class="controls">
            <select name="qq">
                <option value="-1">全部</option>
                <option {if $search['qq'] == 1}selected="selected"{/if} value="1">绑定</option>
                <option {if $search['qq'] == 0}selected="selected"{/if} value="0">未绑定</option>
            </select>
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label">新浪微博：</label>
        <div class="controls">
            <select name="sina">
                <option value="-1">全部</option>
                <option {if $search['sina'] == 1}selected="selected"{/if} value="1">绑定</option>
                <option {if $search['sina'] == 0}selected="selected"{/if} value="0">未绑定</option>
            </select>
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label">微信：</label>
        <div class="controls">
            <select name="weixin">
                <option value="-1">全部</option>
                <option {if $search['weixin'] == 1}selected="selected"{/if} value="1">绑定</option>
                <option {if $search['weixin'] == 0}selected="selected"{/if} value="0">未绑定</option>
            </select>
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label">人人：</label>
        <div class="controls">
            <select name="renren">
                <option value="-1">全部</option>
                <option {if $search['renren'] == 1}selected="selected"{/if} value="1">绑定</option>
                <option {if $search['renren'] == 0}selected="selected"{/if} value="0">未绑定</option>
            </select>
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label">设备类型：</label>
        <div class="controls">
            <select name="device">
                <option value="">请选择</option>
                <option {if $search['device'] == 2}selected="selected"{/if} value="2">iOS</option>
                <option {if $search['device'] == 1}selected="selected"{/if} value="1">安卓</option>
            </select>
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label">跑步总次数:</label>
        <div class="controls">
            <input type="text" placeholder="请输入跑步总次数" name="total_rate" value="{$search['total_rate']}">
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label">排序类型：</label>
        <div class="controls">
            <select name="sort">
                <option value="uid">用户ID</option>
                <option {if $search['sort'] == 'addtime'}selected="selected"{/if} value="addtime">注册日期</option>
                <option {if $search['sort'] == 'nickname'}selected="selected"{/if} value="nickname">昵称</option>
                <option {if $search['sort'] == 'age'}selected="selected"{/if} value="age">年龄</option>
                <option {if $search['sort'] == 'total_mileage'}selected="selected"{/if} value="total_mileage">总里程</option>
                <option {if $search['sort'] == 'total_rate'}selected="selected"{/if} value="total_rate">次数</option>
            </select>
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label">排序方式：</label>
        <div class="controls">
            <select name="order">
                <option {if $search['order'] == 'DESC'}selected="selected"{/if} value="DESC">降序</option>
                <option {if $search['order'] == 'ASC'}selected="selected"{/if} value="ASC">升序</option>
            </select>
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label" >手机号：</label>
        <div class="controls">
          <input type="text" placeholder="请输入用户手机号" name="phone" value="{$search['phone']}">
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label">通讯录人数:</label>
        <div class="controls">
            <select name="address_book">
                <option value="">请选择</option>
                <option {if $search['address_book'] == 1}selected="selected"{/if} value="1">没有人</option>
                <option {if $search['address_book'] == 2}selected="selected"{/if} value="2">有人</option>
            </select>
        </div>
    </div>
    <div class="control-group search-group">
        <div class="controls">
            <input type="hidden" value="search" name="s">
            <button class="btn" type="submit">提交</button>　
            <button class="btn" type="reset">重置</button>
        </div>
    </div>
</form>

<div class="tagDiv">
  <h4>标签(选择后忽略其他选项)</h4>
  <ul id="tagList" class="tagList cl">
    {loop $tagList $k $v}
      <li><a href="index.php?c=admin&a=userList&s=search&tagId={$k}">{$v}</a></li>
    {/loop}
  </ul>
</div>
{/if}
<div class="bs-docs-example pt-20" style="clear:both;">
    <table class="table table-striped">
        <thead>
            <tr>
                <th width="100">用户</th>
                <th width="100">注册日期</th>
                <th>手机号</th>
                <th>性别</th>
                <th>年龄</th>
                <th>里程</th>
                <th>次数</th>
                <th>设备</th>
                <th>通讯录人数</th>
                <th>标签</th>
                <th width="22">新浪</th>
                <th width="22">QQ</th>
                <th width="22">微信</th>
                <th width="22">人人</th>
                <th width="22">手机</th>
                <th width="400">操作</th>
            </tr>
        </thead>
        <tbody>
            <form id="batchActForm" class="form-horizontal" method="post" action="index.php?c=admin&a=batchUser">
            {loop $userData $k $v}
            <tr>
                <td>
                    <input type="checkbox" name="uid[]" value="{$v['uid']}"> &nbsp;&nbsp;
                    <a class="dib" href="#header_{$k}" data-toggle="modal">
                        <image src="{$v['header']}" width="30" height="30" />
                    </a>
                        <a class="btn btn-link dib" href="?c=admin&a=userinfo&uid=$v['uid']" target="_blank">{$v['nickname']}</a>
                </td>

                <div id="header_{$k}" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h3 id="myModalLabel">头像大图</h3>
                    </div>
                    <div class="modal-body" style="height:700px;">
                        <img src="{$v['header']}">
                    </div>
                   
                </div>
                <td>{eval echo date('Y-m-d H:i:s', $v['addtime'])}</td>
                <td>{eval echo $v['phone']}</td>
                <td>{if $v['gender'] == 1}男{elseif $v['gender'] == 2}女{else}保密{/if}</td>
                <td>{eval echo $v['age'] > 100 ? (date("Y") - $v['age']):$v['age']}岁</td>
                <td>{$v['total_mileage']}</td>
                <td>{$v['total_rate']}</td>
                <td>{if $v['client_type'] == 1}安卓{elseif $v['client_type'] == 2}iOS{else}未知{/if}</td>
                <td>{eval echo $v['address_count']?$v['address_count']:0}</td>
                <td>{eval echo isset($userTag[$v['uid']]) ? $userTag[$v['uid']] : ''}</td>
                <td>
                    {if $v['sina'] == 0}<img src="static/bootstrap/img/cms/icon_weibo_1.png">
                    {else}<a href="http://weibo.com/u/{$v['weiboID']}" target="_blank"><img src="static/bootstrap/img/cms/icon_weibo.png"></a>
                    {/if}
                </td>
                <td>
                    <img src="static/bootstrap/img/cms/icon_qq{if $v['qq'] == 0}_1{/if}.png" >
                </td>
                <td>
                    <img src="static/bootstrap/img/cms/icon_weixin{if $v['weixin'] == 0}_1{/if}.png" >
                </td>
                <td>
                    <img src="static/bootstrap/img/cms/icon_renren{if $v['renren'] == 0}_1{/if}.png">
                </td>
                <td>
                    <img src="static/bootstrap/img/cms/icon_phone{if $v['phone'] == 0}_1{/if}.png">
                </td>
                <td>
                    <a class="btn btn-primary" target="_blank" href="?c=admin&a=showHistory&uid=$v['uid']&t=1">跑步记录</a>&nbsp;
                    <a class="btn btn-primary" target="_blank" href="?c=admin&a=medalRecordList&uid=$v['uid']">勋章记录</a>&nbsp;
                    <a class="btn btn-primary" target="_blank" href="?c=admin&a=postList&boardId=-1&uid={$v['uid']}">帖子列表</a>&nbsp;
                    <a class="btn btn-info" href="?c=admin&a=messagePuNiuChat&targetId={$v['uid']}">运营消息</a>&nbsp;
                    <a class="btn btn-info" href="?c=admin&a=blackUser&id={$v['uid']}">黑名单设置</a>
                    <a class="btn btn-info" href="?c=admin&a=userTag&uid={$v['uid']}">用户标签</a>
                    <a class="btn btn-info" href="?c=admin&a=allComments&uid={$v['uid']}">评论列表</a>
                </td>
            </tr>
            {/loop}
            <tr>
                <td colspan="2">
                    <select name="action" onchange="showSubButton(this.value)">
                        <option value="">想干什么……</option>
                        <option value="setTalentUser">选为达人</option>
                        <option value="cancelTalentUser">取消达人</option>
                        <option value="">新需求？</option>
                    </select>
                </td>
                <td colspan="13"><span id="subButton" style="display:none;"><input type="submit" class="btn" value="确定"></span></td>
            </tr>
            </form>
        </tbody>
    </table>
</div>

<div class="pagination">
    <ul>
        {$pageStr}
    </ul>
</div>

<script type="text/javascript">
    function showSubButton(val)
    {
        if(val != '')
        {
            $("#subButton").css("display","block");
        }
        else{
            $("#subButton").css("display","none");
        }
        return;
    }
</script>
<!-- <iframe src="../index.php?c=admin&&a=showTable" scrolling="no" width="100%" height="100%" frameborder="0"> -->

{template footer}